package zuoye.test6;

class Student {
    private String name;
    private int score;
    private Teacher teacher;

    // 空参构造
    public Student() {
    }

    // 满参构造
    public Student(String name, int score, Teacher teacher) {
        this.name = name;
        this.score = score;
        this.teacher = teacher;
    }

    // 定义getMyResult()方法
    public void getMyResult() {
        System.out.println("我是学生" + name + "，我的老师是" + teacher.getName() + "，他教我" + teacher.getCourse() + "学科");
        if (score >= 60) {
            System.out.println("继续加油哦");
        } else {
            System.out.println("成绩太低了，老师" + teacher.getName() + "让我回去罚写100遍");
        }
    }
}